package com.leadingsoft.pwxk.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import com.leadingsoft.pwxk.converter.AuditPerformReportConverter;
import com.leadingsoft.pwxk.dto.AuditPerformReportDto;
import com.leadingsoft.pwxk.service.PerformReportService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(description = "执行报告相关")
@RestController
@RequestMapping("api/performReport")
public class PerformReportController {

	@Autowired
	PerformReportService performReportService;

	@Autowired
	AuditPerformReportConverter auditPerformReportConverter;

	@ApiOperation("执行报告列表")
	@GetMapping(path = "{dataId}")
	@ResponseStatus(code = HttpStatus.OK)
	public List<AuditPerformReportDto> getList( @PathVariable(value = "dataId") String dataId) {
		return auditPerformReportConverter.toListDto(performReportService.getList(dataId));
	}
}
